sociall.login = {
	
	uname : null,	//username input
	pass : null,	//password input
	
	init : function(){
		var uname = sociall.login.uname = $('UserEmail');
		var pass = sociall.login.pass = $('UserPass');
		uname.defaultv = uname.value;
		pass.defaultv = pass.value;
		pass.type = 'text';	//change type to pass, so user will see what is this input
		Event.observe(uname, 'focus', sociall.login.clear);
		Event.observe(pass, 'focus', sociall.login.clear);
		Event.observe(uname, 'blur', sociall.login.check);
		Event.observe(pass, 'blur', sociall.login.check);
	},
	
	clear : function(e){
		//clear default values on focus
		var elem = e.target;
		if(elem.value == elem.defaultv)
			elem.clear();
		if(elem == sociall.login.pass)
			elem.type = 'password';
	},
	
	check : function(e){
		//if the user did not give any input set it back to the default
		var elem = e.target;
		if(!elem.value){
			//set back to the default
			elem.value = elem.defaultv;
		}
		if(elem == sociall.login.pass && elem.value == sociall.login.pass.defaultv)
			elem.type = 'text';
	}
}//sociall.login

document.observe('dom:loaded', function(){
	sociall.login.init();
	});